<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-us" xml:lang="en-us">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
   
    {# Block title should be overwrite #} 
    <title>{% block title %}Metabus - Interlegis{% endblock %}</title>

    {# Base stylesheet could be overwrite, however the new css have to import the base stylesheet #} 
    <link type="text/css" rel="stylesheet" href="{{MEDIA_URL}}css/{% block stylesheet %}base.css{% endblock %}" />

    {# Jquery Lib #}
    <script type="text/javascript" src="{{MEDIA_URL}}js/jquery-1.2.6.js"></script>

    {# Base js definition#}
    <script type="text/javascript" src="{{MEDIA_URL}}js/base.js"></script>

    {# Template js definition. Should be overwrite to import a new js file#}
    <script type="text/javascript" src="{{MEDIA_URL}}js/{% block javascript %}blank.js{% endblock %}"></script>
</head>

<body>
    <div id="container_dialog">
        <p></p>
    </div>

    <div id="container_top">
        <div id="container_bottom">
            <div id="container_body">

                <div id="top">
                </div>

                <hr class="clear"/>

                <div id="header">
                    <form id="search-form" method="GET" action="{% url search %}">
                        <fieldset>
                            <h1>Metabus</h1>
                            <input type="text" value="{{ search_keywords }}" id="keywords" name="keywords" placeholder="digite um termo para buscar e pressione enter..."/>
                            {% if error %}
                                <p class="error">{{error}}</p>
                            {% endif %}
                        </fieldset>
                        <fieldset id="sources">
                            <ul>
                                {% for group in groups %}
                                <li>
                                    <input class="groups" id="{{ group.name }}" type="checkbox" value="{{ group.id }}" {% if group.is_checked %}checked="checked"{% endif %}  name="groups"/>
                                    <label class="groups" for="{{ group.name }}">{{ group.name }}</label>
                                    <fieldset class="groups">
                                        <ul>
                                            {% for source in group.sources %}
                                            <li>
                                                <input id="{{ source.name }}" type="checkbox" value="{{ source.id }}" {% if group.is_checked or source.is_checked %}checked="checked"{% endif %} name="sources"/>
                                                <label for="{{ source.name }}">{{ source.name }}</label>
                                            </li>
                                            {% endfor %}
                                        </ul>
                                    </fieldset>
                                </li>
                                {% endfor %}
                                {% if sources_without_groups %}
                                <li>
                                    <label class="groups others">Outros</label>
                                    <fieldset class="groups">
                                        <ul>
                                            {% for source in sources_without_groups %}
                                            <li>
                                                <input id="{{ source.name }}" type="checkbox" value="{{ source.id }}" {% if source.is_checked %}checked="checked"{% endif %} name="sources"/>
                                                <label for="{{ source.name }}">{{ source.name }}</label>
                                            </li>
                                            {% endfor %}
                                        </ul>
                                    </fieldset>
                                </li>
                                {% endif %}
                            </ul>
                        </fieldset>
                    </form>
                </div>

                <div id="content">
                    {% block content %}
                    {% endblock %}
                </div>
                
                <hr class="clear"/>
    
                <div id="footer">
                    <img src="https://intranet.interlegis.gov.br/sigi/media/images/logo-interlegis.jpg">
                    <p>Copyright © 2008–2010 Interlegis. Todos os Direitos Reservados.<br>
                      É proibido o uso das informações aqui fornecidas fora do âmbito do Interlegis.
                    </p>
                </div>
            </div>
        </div>
    </div>

    <script type="text/javascript">
        {# Start js before google analytics #}
        page_ready()
    </script>

    {% block google-analytics %}
    <script type="text/javascript">
    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
    </script>
    <script type="text/javascript">
    try {
    var pageTracker = _gat._getTracker("UA-6204135-2");
    pageTracker._trackPageview();
    } catch(err) {}</script>
    {% endblock %}
</body>
</html>
